package com.vandytrack.web.server;

import java.util.List;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.vandytrack.web.client.*;
import com.vandytrack.web.query.QueryService;

@SuppressWarnings("serial")
public class QueryServiceImpl extends RemoteServiceServlet implements 
QueryService {
	
	@SuppressWarnings("unchecked")
	public List<VanLocation> getCurrentLocations(String s) {
		// Do something here.
		PMF.get().getPersistenceManager();
		//Query query = pm.newQuery(VanLocation.class);
		String query = "select from " + VanLocation.class.toString();
		List<VanLocation> locations = 
			(List<VanLocation>) PMF.get().getPersistenceManager().newQuery(query).execute();
		
		return locations;
	}
}
